<?php
namespace app\friend\loglic;

class Field
{
    //内容模型字段列表
    public function detail()
    {
        return [
            [
                'op_module'   => 'friend',
                'op_controll' => 'detail',
                'op_action'   => 'index',
                'op_order'    => 1,
                'op_name'     => 'info_id',
                'op_value'    => json_encode([
                    'type'            => 'hidden',
                    'relation'        => 'eq',
                    'data-filter'     => false,
                    'data-visible'    => true,
                    'data-sortable'   => true,
                    'data-width'      => '60',
                    'data-width-unit' => 'px',
                ]),
            ],
            [
                'op_module'   => 'friend',
                'op_controll' => 'detail',
                'op_action'   => 'index',
                'op_order'    => 2,
                'op_name'     => 'info_status',
                'op_value'    => json_encode([
                    'type'         => 'select',
                    'relation'     => 'eq',
                    'option'       => ['normal'=>lang('normal'), 'hidden'=>lang('hidden')],
                    'data-filter'  => true,
                    'data-visible' => false,
                ]),
            ],
            [
                'op_module'   => 'friend',
                'op_controll' => 'detail',
                'op_action'   => 'index',
                'op_order'    => 3,
                'op_name'     => 'info_name',
                'op_value'    => json_encode([
                    'type'            => 'text',
                    'relation'        => 'like',
                    'data-filter'     => true,
                    'data-visible'    => true,
                    'data-width'      => '25',
                    'data-width-unit' => '%',
                    'data-align'      => 'left',
                    'data-class'      => 'text-wrap',
                ]),
            ],
            [
                'op_module'   => 'friend',
                'op_controll' => 'detail',
                'op_action'   => 'index',
                'op_order'    => 4,
                'op_name'     => 'info_slug',
                'op_value'    => json_encode([
                    'type'         => 'text',
                    'relation'     => 'eq',
                    'data-filter'  => false,
                    'data-visible' => false,
                ]),
            ],
            [
                'op_module'   => 'friend',
                'op_controll' => 'detail',
                'op_action'   => 'index',
                'op_order'    => 5,
                'op_name'     => 'friend_referer',
                'op_value'    => json_encode([
                    'type'            => 'url',
                    'relation'        => 'eq',
                    'data-filter'     => false,
                    'data-visible'    => true,
                    'data-width'      => '25',
                    'data-width-unit' => '%',
                    'data-align'      => 'left',
                    'data-class'      => 'text-wrap',
                ]),
            ],
            [
                'op_module'   => 'friend',
                'op_controll' => 'detail',
                'op_action'   => 'index',
                'op_order'    => 6,
                'op_name'     => 'friend_logo',
                'op_value'    => json_encode([
                    'type'         => 'image',
                    'relation'     => 'eq',
                    'data-filter'  => false,
                    'data-visible' => false,
                ]),
            ],
            [
                'op_module'   => 'friend',
                'op_controll' => 'detail',
                'op_action'   => 'index',
                'op_order'    => 7,
                'op_name'     => 'info_order',
                'op_value'    => json_encode([
                    'type'         => 'number',
                    'data-filter'  => false,
                    'data-visible' => true,
                    'data-sortable'=> true,
                ]),
            ],
            [
                'op_module'   => 'friend',
                'op_controll' => 'detail',
                'op_action'   => 'index',
                'op_order'    => 8,
                'op_name'     => 'info_content',
                'op_value'    => json_encode([
                    'type'         => 'textarea',
                    'rows'         => 5,
                    'data-filter'  => false,
                    'data-visible' => false,
                ]),
            ]
        ];
    }
    
    //自助申请字段列表
    public function publishIndex()
    {
        return [
            [
                'op_module'   => 'friend',
                'op_controll' => 'publish',
                'op_action'   => 'index',
                'op_order'    => 1,
                'op_name'     => 'info_name',
                'op_value'    => json_encode([
                    'type'         => 'text',
                    'relation'     => 'eq',
                    'data-visible' => false,
                    'data-filter'  => false,
                ]),
            ],
            [
                'op_module'   => 'friend',
                'op_controll' => 'publish',
                'op_action'   => 'index',
                'op_order'    => 2,
                'op_name'     => 'friend_referer',
                'op_value'    => json_encode([
                    'type'         => 'url',
                    'relation'     => 'eq',
                    'data-visible' => false,
                    'data-filter'  => false,
                ]),
            ],
            [
                'op_module'   => 'friend',
                'op_controll' => 'publish',
                'op_action'   => 'index',
                'op_order'    => 3,
                'op_name'     => 'friend_logo',
                'op_value'    => json_encode([
                    'type'         => 'image',
                    'relation'     => 'eq',
                    'data-visible' => false,
                    'data-filter'  => false,
                ]),
            ],
            [
                'op_module'   => 'friend',
                'op_controll' => 'publish',
                'op_action'   => 'index',
                'op_order'    => 4,
                'op_name'     => 'info_captcha',
                'op_value'    => json_encode([
                    'type'         => 'captcha',
                    'data-visible' => false,
                    'data-filter'  => false,
                ]),
            ]
        ];
    }
}